<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  
  <title>Script for Shell Parsing Parameters | gdme1320 的笔记</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="https://oinkzwurgl.org/hacking/bash_cgi/ https://marc.waeckerlin.org/computer/blog/parsing_of_query_string_in_bash_cgi_scripts    #!/bin/bash echo -e &quot;Content-type: text/html\n\n&quot;  # (internal) ro">
<meta property="og:type" content="article">
<meta property="og:title" content="Script for Shell Parsing Parameters">
<meta property="og:url" content="http://gdme1320.gitee.com/linux/shell/bash_cgi/index.html">
<meta property="og:site_name" content="gdme1320 的笔记">
<meta property="og:description" content="https://oinkzwurgl.org/hacking/bash_cgi/ https://marc.waeckerlin.org/computer/blog/parsing_of_query_string_in_bash_cgi_scripts    #!/bin/bash echo -e &quot;Content-type: text/html\n\n&quot;  # (internal) ro">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2022-03-23T09:59:44.094Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Script for Shell Parsing Parameters">
<meta name="twitter:description" content="https://oinkzwurgl.org/hacking/bash_cgi/ https://marc.waeckerlin.org/computer/blog/parsing_of_query_string_in_bash_cgi_scripts    #!/bin/bash echo -e &quot;Content-type: text/html\n\n&quot;  # (internal) ro">
  
    <link rel="alternate" href="/atom.xml" title="gdme1320 的笔记" type="application/atom+xml">
  
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">

  <link rel="stylesheet" href="/css/styles.css">
  <link rel="stylesheet" href="/css/docs.min.css">
  

</head>
</html>
<body>
  <nav class="navbar navbar-inverse">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-menu-navbar">
      <ul class="nav navbar-nav">
        
          <li><a class href="/index.html">Home</a></li>
        
          <li><a class href="/archives/">Archives</a></li>
        
      </ul>

      <!--
      <ul class="nav navbar-nav navbar-right">
        
          <li><a href="/atom.xml" title="RSS Feed"><i class="fa fa-rss"></i></a></li>
        
      </ul>
      -->
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

  <div class="container bs-docs-container">
  
    <div class="row">
        <div class="col-sm-8 blog-main">
          <article id="post-linux/shell/bash_cgi" class="article article-type-post" itemscope itemprop="blogPost">

  <header class="article-header">
    
  
    <h1 class="article-title" itemprop="name">
      Script for Shell Parsing Parameters
    </h1>
  


  </header>

  <div class="article-meta">
    <div class="article-datetime">
  <a href="/linux/shell/bash_cgi/" class="article-date"><time datetime="2022-03-23T09:59:44.094Z" itemprop="datePublished">2022-03-23</time></a>
</div>

    
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/linux/">linux</a> / <a class="article-category-link" href="/categories/linux/shell/">shell</a>
  </div>


  </div>
  <div class="article-inner">

    <div class="article-entry" itemprop="articleBody">
      
        
<div id="content">
<blockquote>
<p>
<a href="https://oinkzwurgl.org/hacking/bash_cgi/" target="_blank" rel="noopener">https://oinkzwurgl.org/hacking/bash_cgi/</a>
<a href="https://marc.waeckerlin.org/computer/blog/parsing_of_query_string_in_bash_cgi_scripts" target="_blank" rel="noopener">https://marc.waeckerlin.org/computer/blog/parsing_of_query_string_in_bash_cgi_scripts</a>
</p>
</blockquote>
<div class="org-src-container">
<pre class="src src-sh"><span style="font-weight: bold; font-style: italic;">#</span><span style="font-weight: bold; font-style: italic;">!/bin/</span><span style="font-weight: bold;">bash</span>
<span style="font-weight: bold;">echo</span> -e <span style="font-style: italic;">"Content-type: text/html\n\n"</span>

<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">(internal) routine to store POST data</span>
<span style="font-weight: bold;">function</span> <span style="font-weight: bold;">cgi_get_POST_vars</span>()
{
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">only handle POST requests here</span>
    [ <span style="font-style: italic;">"$REQUEST_METHOD"</span> != <span style="font-style: italic;">"POST"</span> ] &amp;&amp; <span style="font-weight: bold;">return</span>

    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">save POST variables (only first time this is called)</span>
    [ ! -z <span style="font-style: italic;">"$QUERY_STRING_POST"</span> ] &amp;&amp; <span style="font-weight: bold;">return</span>

    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">skip empty content</span>
    [ -z <span style="font-style: italic;">"$CONTENT_LENGTH"</span> ] &amp;&amp; <span style="font-weight: bold;">return</span>

    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">check content type</span>
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">FIXME: not sure if we could handle uploads with this..</span>
    [ <span style="font-style: italic;">"${CONTENT_TYPE}"</span> != <span style="font-style: italic;">"application/x-www-form-urlencoded"</span> ] &amp;&amp; <span style="font-style: italic;">\</span>
        <span style="font-weight: bold;">echo</span> <span style="font-style: italic;">"bash.cgi warning: you should probably use MIME type "</span><span style="font-style: italic;">\</span>
             <span style="font-style: italic;">"application/x-www-form-urlencoded!"</span> 1&gt;&amp;2

    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">convert multipart to urlencoded</span>
    <span style="font-weight: bold;">local</span> <span style="font-weight: bold; font-style: italic;">handlemultipart</span>=0 <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">enable to handle multipart/form-data (dangerous?)</span>
    <span style="font-weight: bold;">if</span> [ <span style="font-style: italic;">"$handlemultipart"</span> = <span style="font-style: italic;">"1"</span> -a <span style="font-style: italic;">"${CONTENT_TYPE:0:19}"</span> = <span style="font-style: italic;">"multipart/form-data"</span> ]; <span style="font-weight: bold;">then</span>
        <span style="font-weight: bold; font-style: italic;">boundary</span>=${<span style="font-weight: bold; font-style: italic;">CONTENT_TYPE</span>:30}
        <span style="font-weight: bold;">read</span> -N $<span style="font-weight: bold; font-style: italic;">CONTENT_LENGTH</span> RECEIVED_POST
        <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">FIXME: don't use awk, handle binary data (Content-Type: application/octet-stream)</span>
        <span style="font-weight: bold; font-style: italic;">QUERY_STRING_POST</span>=$(<span style="font-weight: bold;">echo</span> <span style="font-style: italic;">"$RECEIVED_POST"</span> | awk -v <span style="font-weight: bold; font-style: italic;">b</span>=$<span style="font-weight: bold; font-style: italic;">boundary</span> <span style="font-style: italic;">'BEGIN { RS=b"\r\n"; FS="\r\n"; ORS="&amp;" }</span>
<span style="font-style: italic;">           $1 ~ /^Content-Disposition/ {gsub(/Content-Disposition: form-data; name=/, "", $1); gsub("\"", "", $1); print $1"="$3 }'</span>)

    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">take input string as is</span>
    <span style="font-weight: bold;">else</span>
        <span style="font-weight: bold;">read</span> -N $<span style="font-weight: bold; font-style: italic;">CONTENT_LENGTH</span> QUERY_STRING_POST
    <span style="font-weight: bold;">fi</span>

    <span style="font-weight: bold;">return</span>
}

<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">(internal) routine to decode urlencoded strings</span>
<span style="font-weight: bold;">function</span> <span style="font-weight: bold;">cgi_decodevar</span>()
{
    [ $<span style="font-weight: bold; font-style: italic;">#</span> -ne 1 ] &amp;&amp; <span style="font-weight: bold;">return</span>
    <span style="font-weight: bold;">local</span> v t h
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">replace all + with whitespace and append %%</span>
    <span style="font-weight: bold; font-style: italic;">t</span>=<span style="font-style: italic;">"${1//+/ }%%"</span>
    <span style="font-weight: bold;">while</span>  [ ${# <span style="font-weight: bold; font-style: italic;">t</span>} -gt 0 -a <span style="font-style: italic;">"${t}"</span> != <span style="font-style: italic;">"%"</span> ]; <span style="font-weight: bold;">do</span>
        <span style="font-weight: bold; font-style: italic;">v</span>=<span style="font-style: italic;">"${v}${t%%\%*}"</span> <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">digest up to the first %</span>
        <span style="font-weight: bold; font-style: italic;">t</span>=<span style="font-style: italic;">"${t#*%}"</span>       <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">remove digested part</span>
        <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">decode if there is anything to decode and if not at end of string</span>
        <span style="font-weight: bold;">if</span>  [ ${# <span style="font-weight: bold; font-style: italic;">t</span>} -gt 0 -a <span style="font-style: italic;">"${t}"</span> != <span style="font-style: italic;">"%"</span> ]; <span style="font-weight: bold;">then</span>
            <span style="font-weight: bold; font-style: italic;">h</span>=${<span style="font-weight: bold; font-style: italic;">t</span>:0:2} <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">save first two chars</span>
            <span style="font-weight: bold; font-style: italic;">t</span>=<span style="font-style: italic;">"${t:2}"</span> <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">remove these</span>
            <span style="font-weight: bold; font-style: italic;">v</span>=<span style="font-style: italic;">"${v}"</span><span style="font-weight: bold;">`echo -e \\\\x${h}`</span> <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">convert hex to special char</span>
        <span style="font-weight: bold;">fi</span>
    <span style="font-weight: bold;">done</span>
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">return decoded string</span>
    <span style="font-weight: bold;">echo</span> <span style="font-style: italic;">"${v}"</span>
    <span style="font-weight: bold;">return</span>
}

<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">routine to get variables from http requests</span>
<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">usage: cgi_getvars method varname1 [.. varnameN]</span>
<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">method is either GET or POST or BOTH</span>
<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">the magic varible name ALL gets everything</span>
<span style="font-weight: bold;">function</span> <span style="font-weight: bold;">cgi_getvars</span>()
{
    [ $<span style="font-weight: bold; font-style: italic;">#</span> -lt 2 ] &amp;&amp; <span style="font-weight: bold;">return</span>
    <span style="font-weight: bold;">local</span> q p k v s
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">get query</span>
    <span style="font-weight: bold;">case</span> $<span style="font-weight: bold; font-style: italic;">1</span><span style="font-weight: bold;"> in</span>
        GET)
            [ ! -z <span style="font-style: italic;">"${QUERY_STRING}"</span> ] &amp;&amp; <span style="font-weight: bold; font-style: italic;">q</span>=<span style="font-style: italic;">"${QUERY_STRING}&amp;"</span>
            ;;
        POST)
            cgi_get_POST_vars
            [ ! -z <span style="font-style: italic;">"${QUERY_STRING_POST}"</span> ] &amp;&amp; <span style="font-weight: bold; font-style: italic;">q</span>=<span style="font-style: italic;">"${QUERY_STRING_POST}&amp;"</span>
            ;;
        BOTH)
            [ ! -z <span style="font-style: italic;">"${QUERY_STRING}"</span> ] &amp;&amp; <span style="font-weight: bold; font-style: italic;">q</span>=<span style="font-style: italic;">"${QUERY_STRING}&amp;"</span>
            cgi_get_POST_vars
            [ ! -z <span style="font-style: italic;">"${QUERY_STRING_POST}"</span> ] &amp;&amp; <span style="font-weight: bold; font-style: italic;">q</span>=<span style="font-style: italic;">"${q}${QUERY_STRING_POST}&amp;"</span>
            ;;
    <span style="font-weight: bold;">esac</span>
    <span style="font-weight: bold;">shift</span>
    <span style="font-weight: bold; font-style: italic;">s</span>=<span style="font-style: italic;">" $* "</span>
    <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">parse the query data</span>
    <span style="font-weight: bold;">while</span> [ ! -z <span style="font-style: italic;">"$q"</span> ]; <span style="font-weight: bold;">do</span>
        <span style="font-weight: bold; font-style: italic;">p</span>=<span style="font-style: italic;">"${q%%&amp;*}"</span>  <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">get first part of query string</span>
        <span style="font-weight: bold; font-style: italic;">k</span>=<span style="font-style: italic;">"${p%%=*}"</span>  <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">get the key (variable name) from it</span>
        <span style="font-weight: bold; font-style: italic;">v</span>=<span style="font-style: italic;">"${p#*=}"</span>   <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">get the value from it</span>
        <span style="font-weight: bold; font-style: italic;">q</span>=<span style="font-style: italic;">"${q#$p&amp;*}"</span> <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">strip first part from query string</span>
        <span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">decode and assign variable if requested</span>
        [ <span style="font-style: italic;">"$1"</span> = <span style="font-style: italic;">"ALL"</span> -o <span style="font-style: italic;">"${s/ $k /}"</span> != <span style="font-style: italic;">"$s"</span> ] &amp;&amp; <span style="font-style: italic;">\</span>
            <span style="font-weight: bold;">export</span> <span style="font-style: italic;">"$k"</span>=<span style="font-style: italic;">"`cgi_decodevar \"$v\"`"</span>
    <span style="font-weight: bold;">done</span>
    <span style="font-weight: bold;">return</span>
}

<span style="font-weight: bold; font-style: italic;"># </span><span style="font-weight: bold; font-style: italic;">register all GET and POST variables</span>
cgi_getvars BOTH ALL

cat &lt;&lt;EOF
<span style="font-weight: bold;">&lt;html&gt;</span>
<span style="font-weight: bold;">&lt;body&gt;</span>
<span style="font-weight: bold;">&lt;form action="?foo=${foo:=123}" method="POST" enctype="application/x-www-form-urlencoded"&gt;</span>
<span style="font-weight: bold;">bar: &lt;input type="text" name="bar" value="$bar"&gt;&lt;br/&gt;</span>
<span style="font-weight: bold;">foobar: &lt;textarea name="foobar"&gt;$foobar&lt;/textarea&gt;&lt;/br&gt;</span>
<span style="font-weight: bold;">&lt;input type="submit"&gt;</span>
<span style="font-weight: bold;">&lt;/form&gt;</span>

<span style="font-weight: bold;">&lt;pre&gt;foo=$foo&lt;/pre&gt;</span>
<span style="font-weight: bold;">&lt;pre&gt;bar=$bar&lt;/pre&gt;</span>
<span style="font-weight: bold;">&lt;pre&gt;foobar=$foobar&lt;/pre&gt;</span>

<span style="font-weight: bold;">&lt;/body&gt;</span>
<span style="font-weight: bold;">&lt;/html&gt;</span>
<span style="font-weight: bold;">EOF</span>
</pre>
</div>
</div>
<div class="status" id="postamble">
<p class="author">Author: amo</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer" target="_blank" rel="noopener">Validate</a></p>
</div>

      
    </div>

    
      

    

    <footer class="article-footer">
      <a data-url="http://gdme1320.gitee.com/linux/shell/bash_cgi/" data-id="cl13eo7mk00ebhjv4jbigfeaq" class="article-share-link">
        <i class="fa fa-share"></i> Share
      </a>
      
      

    </footer>
  </div>
  
    
<ul id="article-nav" class="nav nav-pills nav-justified">
  
  <li role="presentation">
    <a href="/linux/shell/shell-script/" id="article-nav-older" class="article-nav-link-wrap">
      <i class="fa fa-chevron-left pull-left"></i>
      <span class="article-nav-link-title">Shell Script Getting Start</span>
    </a>
  </li>
  
  
  <li role="presentation">
    <a href="/java/acessing-generic-types-at-runtime/" id="article-nav-newer" class="article-nav-link-wrap">
      <span class="article-nav-link-title">获取泛型类型</span>
      <i class="fa fa-chevron-right pull-right"></i>
    </a>
  </li>
  
</ul>


  
</article>




        </div>
        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
          
  
  <div class="sidebar-module">
    <h4>Categories</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/apps/">apps</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/architecture/">architecture</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/">devops</a><span class="sidebar-module-list-count">10</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubectl/">kubectl</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/devops/kubernetes/">kubernetes</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/">dotnet</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/dotnet/entityframework/">entityframework</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/elasticsearch/">elasticsearch</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/">emacs</a><span class="sidebar-module-list-count">4</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/emacs/org-mode/">org-mode</a><span class="sidebar-module-list-count">3</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/git/">git</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/graphql/">graphql</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/groovy/">groovy</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/">java</a><span class="sidebar-module-list-count">52</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/concurrent/">concurrent</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/jackson/">jackson</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/shiro/">shiro</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring/">spring</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/">spring-amqp</a><span class="sidebar-module-list-count">5</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-amqp/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-jpa/">spring-jpa</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/spring-security/">spring-security</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/">thymeleaf</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/java/thymeleaf/maven/">maven</a><span class="sidebar-module-list-count">1</span></li></ul></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/jenkins/">jenkins</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/journal/">journal</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/js/">js</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/">linux</a><span class="sidebar-module-list-count">35</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kde/">kde</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/">kross</a><span class="sidebar-module-list-count">3</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/kross/ktorrent-scripts/">ktorrent-scripts</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/shell/">shell</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/linux/tcp/">tcp</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/lisp/">lisp</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mongodb/">mongodb</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mssql/">mssql</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/mysql/">mysql</a><span class="sidebar-module-list-count">12</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/nginx/">nginx</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/node/">node</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/">postgresql</a><span class="sidebar-module-list-count">2</span><ul class="sidebar-module-list-child"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/postgresql/client/">client</a><span class="sidebar-module-list-count">1</span></li></ul></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/python/">python</a><span class="sidebar-module-list-count">19</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/regex/">regex</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/rfc/">rfc</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/vim/">vim</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/windows/">windows</a><span class="sidebar-module-list-count">7</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tags</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ReentrantLock/">ReentrantLock</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/nohup/">nohup</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/pandoc/">pandoc</a><span class="sidebar-module-list-count">1</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Tag Cloud</h4>
    <p class="tagcloud">
      <a href="/tags/ReentrantLock/" style="font-size: 10px;">ReentrantLock</a> <a href="/tags/nohup/" style="font-size: 10px;">nohup</a> <a href="/tags/pandoc/" style="font-size: 10px;">pandoc</a>
    </p>
  </div>


  
  <div class="sidebar-module">
    <h4>Archives</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2919/06/">June 2919</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/03/">March 2022</a><span class="sidebar-module-list-count">58</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2022/01/">January 2022</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/11/">November 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/10/">October 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/04/">April 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/03/">March 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/02/">February 2021</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2021/01/">January 2021</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/12/">December 2020</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/11/">November 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/10/">October 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/09/">September 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/07/">July 2020</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/06/">June 2020</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/04/">April 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/03/">March 2020</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/02/">February 2020</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2020/01/">January 2020</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/12/">December 2019</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/11/">November 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/10/">October 2019</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/09/">September 2019</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/08/">August 2019</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/07/">July 2019</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/06/">June 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/05/">May 2019</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/04/">April 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/03/">March 2019</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/02/">February 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2019/01/">January 2019</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/11/">November 2018</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/10/">October 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/08/">August 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/07/">July 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/06/">June 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2018/03/">March 2018</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/07/">July 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/06/">June 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2017/04/">April 2017</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/05/">May 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/1970/01/">January 1970</a><span class="sidebar-module-list-count">9</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>Recents</h4>
    <ul class="sidebar-module-list">
      
        <li>
          <a href="/java/acessing-generic-types-at-runtime/">获取泛型类型</a>
        </li>
      
        <li>
          <a href="/linux/shell/bash_cgi/">Script for Shell Parsing Parameters</a>
        </li>
      
        <li>
          <a href="/linux/shell/shell-script/">Shell Script Getting Start</a>
        </li>
      
        <li>
          <a href="/linux/tcp/network-tcp-performance-turning-with-sysctl/">【翻译】Sysctl调节Linux网络性能</a>
        </li>
      
        <li>
          <a href="/java/concurrent/aqs-src/">AQS源码笔记</a>
        </li>
      
    </ul>
  </div>



        </div>
    </div>
  </div>
  <footer class="blog-footer">
  <div class="container">
    <div id="footer-info" class="inner">
      &copy; 2022 gdme1320<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

  

<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script> -->

<script src="/js/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>



<script src="/js/script.js"></script>

</body>
</html>
